import { Scene, Cameras } from "phaser";

// 相机对象
let camera: Cameras.Scene2D.Camera;

export class End extends Scene {
    constructor() {
        super("End");
    }
    init() {
        camera = this.cameras.main;
    }
    create() {
        this.add.image(camera.width / 2, 100, "game_over");

        // 开始按钮
        var startButton = this.add.image(camera.width / 2, camera.height - 100, "start_button").setInteractive();
        // 按钮事件
        startButton.on("pointerdown", () => {
            // 关闭当前场景并开启 Main 场景
            this.scene.start("Main");
        });
    }
}
